package com.ease.platform.access.service.impl;

import java.util.List;

import com.ease.model.DatabaseManyToOneConstraint;
import com.ease.model.criteria.DatabaseManyToOneConstraintCriteria;
import com.ease.platform.access.service.DatabaseManyToOneConstraintAccessService;

/**
 * 
 * @author nathanleewei
 * 
 */
public class DatabaseManyToOneConstraintAccessServiceImpl extends AbstractParameterizedBeanJdbcTemplateAccessServiceImpl<DatabaseManyToOneConstraint> implements
		DatabaseManyToOneConstraintAccessService {

	public List<DatabaseManyToOneConstraint> findBySupplierTableName(String supplierTableName) {
		DatabaseManyToOneConstraintCriteria riteria = new DatabaseManyToOneConstraintCriteria();
		riteria.setSupplierTableName(supplierTableName);
		riteria.setOwner(owner);
		return this.find(riteria);
	}

	public List<DatabaseManyToOneConstraint> findByClientTableName(String clientTableName) {
		DatabaseManyToOneConstraintCriteria riteria = new DatabaseManyToOneConstraintCriteria();
		riteria.setClientTableName(clientTableName);
		riteria.setOwner(owner);
		return this.find(riteria);
	}

	public List<DatabaseManyToOneConstraint> find(String clientTableName, String supplierTableName) {
		DatabaseManyToOneConstraintCriteria riteria = new DatabaseManyToOneConstraintCriteria();
		riteria.setClientTableName(clientTableName);
		riteria.setSupplierTableName(supplierTableName);
		riteria.setOwner(owner);
		return this.find(riteria);
	}

}
